<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>控制台管理中心</title>
    <link rel="stylesheet" href="/sources/dist/css/normalize.css">
    <link rel="stylesheet" href="/sources/dist/css/common.css">
    <link rel="stylesheet" href="/sources/dist/css/table_info.css">
</head>
<body>
<c:import url="./../user/header.jsp"></c:import>
<!-----------------------中间内容----------------------------------------------->
<section class="table">
    <div class="table_classification">
        <div class="classification_left">
            <a href="javascript:;" class="tab-item">已上线(<span class="total_num1"></span>)</a>
            <a href="javascript:;" class="tab-item checked">未上线(<span class="total_num2"></span>)</a>
        </div>
        <div class="classification_center">
            <input type="text" placeholder="请输入完整的应用名称或ID" class="search_ipt">
            <a href="javascript:;" class="search"></a>
        </div>
        <div class="classification_right">
            <a class="createApp">创建应用</a>
        </div>
    </div>
    <div class="table_info_none">
        <table cellpadding="0" cellspacing="0" border="0" class="able">
            <thead>
            <tr>
                <th><span>应用ID</span></th>
                <th><span>应用名称</span></th>
                <th><span>状态</span></th>
                <th><span>下载量</span></th>
                <th><span>软件大小</span></th>
                <th><span>创建时间</span></th>
                <th><span>操作</span></th>
            </tr>
            </thead>
            <tbody>
            <c:forEach var="data" items="${dataMap}">
                <c:if test="${data[6]==1 || data[6]==2}">
                    <tr>
                        <td class="id"><span>${data[0]}</span></td>
                        <td class="name"><a
                                href="/SoftwareAction/user/softwareInfo?id=${data[0]}"><span>${data[1]}</span></a>
                        </td>
                        <td class="downofflie"><span><c:choose>
                            <c:when test="${data[6]==1}">已上线</c:when>
                            <c:otherwise>下线审核中</c:otherwise>
                        </c:choose></span></td>
                        <td><span><c:if test="${data[5]==null}">0</c:if> <c:if
                                test="${data[5]!=null}">${data[5]}</c:if></span></td>

                        <td><span>${data[2]}</span></td>
                        <td><span><fmt:formatDate value="${data[3]}" pattern="yyyy-MM-dd HH:mm"/></span></td>
                        <td><span>
                            <a onclick="downOffline(this,'${data[0]}')" class="downofflie1">申请下架 &nbsp;&nbsp;</a>
                            <a href="/SoftwareAction/user/inputUpdateSoftware?rid=${data[0]}"
                               style="color: #0f8cca;">更新</a>
                            </span>

                        </td>
                    </tr>
                </c:if>
            </c:forEach>
            </tbody>
        </table>
        <table cellpadding="0" cellspacing="0" border="0" class="unable">
            <thead>
            <tr>
                <th><span>应用ID</span></th>
                <th><span>应用名称</span></th>
                <th><span>状态</span></th>
                <th><span>软件大小</span></th>
                <th><span>创建时间</span></th>
                <th><span>操作</span></th>
            </tr>
            </thead>
            <tbody>
            <c:forEach var="data" items="${dataMap}">
                <c:if test="${data[6]==0|| data[6]==-1 ||data[6]==-2||data[6]==-3}">
                    <tr>
                        <td class="id"><span>${data[0]}</span></td>
                        <td class="name"><span>${data[1]}</span></td>
                        <td><span><c:choose>
                            <c:when test="${data[6]==-1}">申请未通过</c:when>
                            <c:when test="${data[6]==-2}">下线通过</c:when>
                            <c:when test="${data[6]==-3}">下线未通过</c:when>
                            <c:otherwise>审核中</c:otherwise>
                        </c:choose></span></td>
                        <td><span>${data[2]}</span></td>
                        <td><span><fmt:formatDate value="${data[3]}" pattern="yyyy-MM-dd HH:mm"/></span></td>
                        <td class="delete" id="${data[7]}" onclick="deleteApk(this,'${data[0]}','${data[7]}')">
                            <span>删除应用</span>
                        </td>
                    </tr>
                </c:if>
            </c:forEach>
            </tbody>
        </table>
    </div>
    <span class="info_total fl_right">共 <span class="total_num"></span> 条信息</span>

</section>
<div class="model">
    <div class="model_div">
        <div class="delete_title">删除？</div>
        <div class="delete_content">是否删除当前应用？</div>
        <div class="delete_btn fl_right">
            <a href="javascript:;">确定</a>
            <a href="javascript:;">取消</a>
        </div>
    </div>
</div>
<!--------------------------------------------------------------------------->
<span id="url" hidden>/</span>
<script src="/sources/dist/js/jquery.min.js"></script>
<script src="/sources/dist/js/table_info.js"></script>
<script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
<script>
    $(document).ready(function () {
        $('.createApp').click(function () {
            $.get("/indexUserAction/user/check", function (data) {
                if (data.valueOf() == 'true') {
                    window.location.href = '/SoftwareAction/user/inputUpload';
                } else {
                    layer.msg('账号审核中,请通过后创建应用！', {icon: 1, time: 1000});
                }
            });
        });
    });

</script>


</body>
</html>